UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T7xDJy7ebpM9Yirkqwi6yxqeJV+/fRJm0eS4WzYnn7I='
WHERE
key_id = '853f92b974fcd1d7e7f65973829fb5328d68fc72db46515092dd2af8bc019662'
AND (
token = 'T7xDJy7ebpM9Yirkqwi6yxqeJV+/fRJm0eS4WzYnn7I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)