UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o4ctEeNoBEBVcv6/ahQgsEGsye0Ui/ummT2xhTPrHmk='
WHERE
key_id = '7112e829caea1e3fb80bce2e8019c3b224fe38b2501b649503e86ec41f005d4b'
AND (
token = 'o4ctEeNoBEBVcv6/ahQgsEGsye0Ui/ummT2xhTPrHmk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)