UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'abuLR9BvUpLAZXfvlUxhq5i5HZVttUYLWDancbDz8WU='
WHERE
key_id = '180f09122a07364001657d4bcc840e8c0c338d92a7fda82d5ff9952201132a30'
AND (
token = 'abuLR9BvUpLAZXfvlUxhq5i5HZVttUYLWDancbDz8WU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)