UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w/N+D661lVkspMR8eP/+rtEGREohNbg1GovybY86uy8=' 
WHERE 
  key_id = '8cf25cf3ad89049fe5a59a52ccdfe161910374205ec8a007dc427dea469ec8c9' 
  AND (
    token = 'w/N+D661lVkspMR8eP/+rtEGREohNbg1GovybY86uy8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020