UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Obdr52/vL96VObHRGc/T/2anu2/gJ3QD7fQEBO9nYnI=' 
WHERE 
  key_id = 'ec4d18ed9c9fd799f321e45dc6abc425b6d09a2637df055055b4f0a48db290ea' 
  AND (
    token = 'Obdr52/vL96VObHRGc/T/2anu2/gJ3QD7fQEBO9nYnI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050