UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FofUSVeNsDHvoqZ+5ctsFqAKraBp/fpJWk//KlBSiHs='
WHERE
key_id = 'da249312922a965ec211a069450af467f80b54ca1eaa4eb71f51ab499b490ae5'
AND (
token = 'FofUSVeNsDHvoqZ+5ctsFqAKraBp/fpJWk//KlBSiHs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)