UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zZGld2FArCF4Scln8L6TJ0yR5jsOXvUr+0uDnTpozt4=' 
WHERE 
  key_id = 'e0d8cad194ab14588fa06850bc41c94cfaf5a3a401c4560a9be67813ef991f2b' 
  AND (
    token = 'zZGld2FArCF4Scln8L6TJ0yR5jsOXvUr+0uDnTpozt4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035