UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uIlsUs/nILeOIfwb8zXYAdxQvf63DYitH1gXl5uqA5U=' 
WHERE 
  key_id = '5ebf468c3b5a4f425290a55faeb0b863152997a2f9176879b3722f02ca2b5293' 
  AND (
    token = 'uIlsUs/nILeOIfwb8zXYAdxQvf63DYitH1gXl5uqA5U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032