UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jWeB+lS4+Cqudk2JX9VWAtlilOKOntr7dqMJANppM/0=' 
WHERE 
  key_id = '635a42451825f1cd872445590314b27388aa023e2a737f29e28f41a8d7acede4' 
  AND (
    token = 'jWeB+lS4+Cqudk2JX9VWAtlilOKOntr7dqMJANppM/0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016