UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'myKhvFWpEUFpAJ+eUF5Z0dKiFRbcffNIDCRXoGZintk='
WHERE
key_id = '775904097e83a72daafb13150fbcc9d966104d3dadc5418bb2be81aa7065824c'
AND (
token = 'myKhvFWpEUFpAJ+eUF5Z0dKiFRbcffNIDCRXoGZintk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)