UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k5Me85pGPATocf/SFOYJiVza2DfhejGpXi5Dbvp8fLI='
WHERE
key_id = 'b13ce83c01ec448cda0ffe887c5d6b847e2feabb663af500850236de6ea86597'
AND (
token = 'k5Me85pGPATocf/SFOYJiVza2DfhejGpXi5Dbvp8fLI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)