UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F8qqrc0ayPd21SdX8faCjXmf3H/JUfR7acmU5Vdx+Ak='
WHERE
key_id = '5b071a7256f1652d430a170fce1d870aa8d8fc563fa37fcfa28bbdc1be59a06d'
AND (
token = 'F8qqrc0ayPd21SdX8faCjXmf3H/JUfR7acmU5Vdx+Ak='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)