UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YyKRnl+PrHLoP8L1h3Vm6uRCbWIkcWz2SEtLz0/pHis='
WHERE
key_id = '147e7efefb1b6d49cb294ea6736765e8e9259c13b19d8c6254a5cc1799220bbd'
AND (
token = 'YyKRnl+PrHLoP8L1h3Vm6uRCbWIkcWz2SEtLz0/pHis='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)