UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'g1IAyD0+vVX6y2J66OCYN+BVojoK2TP5a3L1sFtB0uY=' 
WHERE 
  key_id = 'e7e0db5d69973e3a2c6b3c51dd3ff62f9b3aecb8d77f8f7d9ca6443516685a0a' 
  AND (
    token = 'g1IAyD0+vVX6y2J66OCYN+BVojoK2TP5a3L1sFtB0uY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026