UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1pO/oHRnjksZHGiqzC+Yb9KCK4pXY3/x9ZwfDwHbUYY=' 
WHERE 
  key_id = '52c1517834487321d6be7e04f705f8ae01ba1579fc52ff02c7a93a406be7255e' 
  AND (
    token = '1pO/oHRnjksZHGiqzC+Yb9KCK4pXY3/x9ZwfDwHbUYY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039