UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l69GDSA5HNBvsLQUB3EVRZVM5Bm5afLXvcVfe7v6M0U='
WHERE
key_id = '9d739b046c432380da024274a0cc9fee16752554ed5a8bfc370003c92f2313ae'
AND (
token = 'l69GDSA5HNBvsLQUB3EVRZVM5Bm5afLXvcVfe7v6M0U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)