UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZnEhCvoMEPN4WPhjZgPr/dSbhjXI01kp7U6Ky4IMXsw=' 
WHERE 
  key_id = '32a3402e66965cd0931cadfbbe1fc1f2f55111a6aa39f5dd74d99d02fce77e6d' 
  AND (
    token = 'ZnEhCvoMEPN4WPhjZgPr/dSbhjXI01kp7U6Ky4IMXsw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031