UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cVjKTd8t3YEsq6uj9LkTvvxR4L7pnNmuCAD0iiytgZA='
WHERE
key_id = '2153ad80dc3281ce3ea3842dc1ea30a6a7a8f5e5b297c00d2b32f06427203603'
AND (
token = 'cVjKTd8t3YEsq6uj9LkTvvxR4L7pnNmuCAD0iiytgZA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)