UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QRLyIwpUarQtypRgtbGI5JzkCLBD+afYz0Swmqu1Hmw=' 
WHERE 
  key_id = 'b92af5027ef0ee6e92204a1f843b4d9e815a86997ff3a4afb2a7a1add754edf6' 
  AND (
    token = 'QRLyIwpUarQtypRgtbGI5JzkCLBD+afYz0Swmqu1Hmw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023