UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pzaahXHwQmCdViDwUwOeFHrunVC0siFBgNsPsu0d/vE='
WHERE
key_id = 'f5a28f110ad3e0da0bb1f7b805cca733bdc36016381a1bcb3e44c742bd6714a2'
AND (
token = 'pzaahXHwQmCdViDwUwOeFHrunVC0siFBgNsPsu0d/vE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)