UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aA6KGWQ21eeVo3aCJzuzobdKMRzG/XknrxqoSYeGPeE='
WHERE
key_id = 'd3414a272a698b0e42ae20aa7c4e3cac1ca80358da193417e26fac6d41c39656'
AND (
token = 'aA6KGWQ21eeVo3aCJzuzobdKMRzG/XknrxqoSYeGPeE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)