UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+txSIXlDX//cpJ3Q3PHvv/xP9XBM7sx2pPzR2l4Ep3A='
WHERE
key_id = '47b810bad661e7e423ab6fd5775a2e38ad185ef9416e23b76efed0032c48c80f'
AND (
token = '+txSIXlDX//cpJ3Q3PHvv/xP9XBM7sx2pPzR2l4Ep3A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)