UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OvWUz4uA+1rYYUrzCRsITfW2/0lN7dJaFYngRO9UaPE=' 
WHERE 
  key_id = 'd8774265d21aff37258c5d337e57c6ba78968a3b41044e24fe7d516372412bd3' 
  AND (
    token = 'OvWUz4uA+1rYYUrzCRsITfW2/0lN7dJaFYngRO9UaPE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017