UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KgxAAPXv4mRVu+PDbEh3bH8Q0tHbr2h1kl7eNo57rQs=' 
WHERE 
  key_id = 'c4c7914566de9894f384673ba1c0bea371875b33c9a21bdcd8ba8431c4baa826' 
  AND (
    token = 'KgxAAPXv4mRVu+PDbEh3bH8Q0tHbr2h1kl7eNo57rQs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00066