UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f0VNJP1bc140x9fZ/5eyrcoxU1manqIDLN/9vfzjHY4=' 
WHERE 
  key_id = '4e0d1018e6198f6f786bc59b96d3d2de8c7853dfdd6546ecc25708d34aaa3e9c' 
  AND (
    token = 'f0VNJP1bc140x9fZ/5eyrcoxU1manqIDLN/9vfzjHY4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049