UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '63L3ZByMhQKQHNkMDe31QQTSPkiowLs9rvOMvOkS3pc='
WHERE
key_id = '1bae5c40410a21d812cbae2935d0d3b050e0e55d963b2613d0f4e0d5a67e0982'
AND (
token = '63L3ZByMhQKQHNkMDe31QQTSPkiowLs9rvOMvOkS3pc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)