UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rq5VuqZB5VazP6gFvg4mxvbz54Q+BKY/nY4l196/Hl0='
WHERE
key_id = '2b3fb751a34eccf98b6be2bf6f92696fedf721cd8206f66ea56e7e14fc543b3b'
AND (
token = 'rq5VuqZB5VazP6gFvg4mxvbz54Q+BKY/nY4l196/Hl0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)