UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kyREC9HhUIhNc99xbxQQZmL8ay02ZRnPG/KGIwC99tM=' 
WHERE 
  key_id = '5d3f2c23ad926112c4d4f292581ac8e1414ed8b0072027f65648fec05baa2100' 
  AND (
    token = 'kyREC9HhUIhNc99xbxQQZmL8ay02ZRnPG/KGIwC99tM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050