UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'A+dUKt48rMTZTN9i3CsV99fwIR9pN3tz9a8X9tczCuo=' 
WHERE 
  key_id = '96526136ee763ac2020d6f7f7749c8db0c7cf7d3f57b9be37dc3f6de6cbd338d' 
  AND (
    token = 'A+dUKt48rMTZTN9i3CsV99fwIR9pN3tz9a8X9tczCuo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029