UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jJdH1OCarr7nQMZuUBdL9Nu/yPjXFrbhkQeAPnzDgZc='
WHERE
key_id = 'c153962f9149bd39a4e68e9632f45ca98815752c0c82dda425ccf55d3099f474'
AND (
token = 'jJdH1OCarr7nQMZuUBdL9Nu/yPjXFrbhkQeAPnzDgZc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)