UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tSsVJn03Xa9n1vdgbDHqKfl4K1DEYMAT1rITR7uuniU=' 
WHERE 
  key_id = '33c3ea466f646e2cac9ed4a1bc4c32802bf8b023b512a7452d9bf20dfe45a1d8' 
  AND (
    token = 'tSsVJn03Xa9n1vdgbDHqKfl4K1DEYMAT1rITR7uuniU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020