UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TxrGLF4OhcKRTTwyPrFMybIpvePXq/CBH5pAFOmcEjw=' 
WHERE 
  key_id = '923e3cb5747c11b6f84328105a2808a1fbc58ea13b45cd8863c23331fb65fac2' 
  AND (
    token = 'TxrGLF4OhcKRTTwyPrFMybIpvePXq/CBH5pAFOmcEjw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018