UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tiUldTV+Ak3dG+jVeAfdS+DAOz/Ju+ltjlWXl+UNUX0=' 
WHERE 
  key_id = '29e8151276d5d2f55c33187ed2d2bed5288c4718d27de073042c1e7be93f4df3' 
  AND (
    token = 'tiUldTV+Ak3dG+jVeAfdS+DAOz/Ju+ltjlWXl+UNUX0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032