UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bu0XTbuMJ18e3OECF4vDTK7z0onf3/j5ga16JD+UZ14='
WHERE
key_id = '306818de167196d1e54839340f66e14b38f5f4c2a155be6d586d5c7a88038c35'
AND (
token = 'bu0XTbuMJ18e3OECF4vDTK7z0onf3/j5ga16JD+UZ14='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)