UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7D7IOun7F/gsox13RVQDohZHEtH939D02ezD8at00rk=' 
WHERE 
  key_id = 'ac7c3d3473ea8570289f68848500105a742515d7009e94a3bfc418e53a3b8757' 
  AND (
    token = '7D7IOun7F/gsox13RVQDohZHEtH939D02ezD8at00rk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020