UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CTxg5gm1m82WkyleBNP8v+hnon+yDMy2ewqcpPvDlxM='
WHERE
key_id = '44dbf70d0ee1781bd0c01d9077dcba130c3ebf4f84641936912e905fd789eaf9'
AND (
token = 'CTxg5gm1m82WkyleBNP8v+hnon+yDMy2ewqcpPvDlxM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)