UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XXngJcYd4bBNmS87xb/GdLi47uI86C1uP/rK5XkNtzk=' 
WHERE 
  key_id = '33ee283f0d57b94bd101dcb2bc97268a89833c79d7b1baaa3c0e13d63d35a1c9' 
  AND (
    token = 'XXngJcYd4bBNmS87xb/GdLi47uI86C1uP/rK5XkNtzk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034