UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EXfeeLEsKSc/pkUGrt+ve06jUfJfhx2313OLWgtOVPI=' 
WHERE 
  key_id = '2adca03f67d748ec77b64dd1db1650bf5338e13c2f9a8680edee1aaa0b088a2f' 
  AND (
    token = 'EXfeeLEsKSc/pkUGrt+ve06jUfJfhx2313OLWgtOVPI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037