UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VfIaQvF8AqokBxCPPPeZaJzXt3pQIF6ETO4UR1qV5T0='
WHERE
key_id = 'b47315ce11a8be73a035674236bf08f71a3f5efde337ea493444e35d6599dc75'
AND (
token = 'VfIaQvF8AqokBxCPPPeZaJzXt3pQIF6ETO4UR1qV5T0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)