UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7DyUumkFQGi/wnUVBHdsyPdAbVw5m11DuUGVUIsABpQ='
WHERE
key_id = 'fd087e1e64b3ff351417a584072be467b53d66a49bcd1800e7f19ebbfdb3e6c7'
AND (
token = '7DyUumkFQGi/wnUVBHdsyPdAbVw5m11DuUGVUIsABpQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)