UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dD2yPGyDJNQUmJ27l+dEBg/hQEZ5HnSbFaGaU1u5hUE='
WHERE
key_id = '5dc4bf6dbe35b5254efb267024db9897e29653c26a45f84a5f006291b48b580d'
AND (
token = 'dD2yPGyDJNQUmJ27l+dEBg/hQEZ5HnSbFaGaU1u5hUE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)