UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uGjxsmVoZR9Xo6iDlL+ZGRqlxO+Kd7Hgm3SAjWfb1ak='
WHERE
key_id = '6b29a98daadb730b50c932b1b91fa95024d5d8c314d42c0a6be279b07dfd8112'
AND (
token = 'uGjxsmVoZR9Xo6iDlL+ZGRqlxO+Kd7Hgm3SAjWfb1ak='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)