UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/oa0jcGsjYwq8qlyOoVm7GNWNRjcmAV/tNzprclT0Tk=' 
WHERE 
  key_id = 'ccc70e0993e22356b46f06356f1dfe6e55e2cbbe526a13de4a6e2c605f812335' 
  AND (
    token = '/oa0jcGsjYwq8qlyOoVm7GNWNRjcmAV/tNzprclT0Tk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058