UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4VFef+4juHS1vtJUFalfiDTyaSdeeR7mC9YSWyzA0iQ='
WHERE
key_id = '83d816884882db444d75e46779c97c1f30deb16557b12dfe58758ed45cca1630'
AND (
token = '4VFef+4juHS1vtJUFalfiDTyaSdeeR7mC9YSWyzA0iQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)